# Created by: Joe Marcus Clarke <marcus@FreeBSD.org>
# $FreeBSD: head/devel/py-gobject3/Makefile 339634 2014-01-13 21:00:02Z rene $
#   $MCom: ports/trunk/devel/py-gobject3/Makefile 17268 2013-04-01 05:13:11Z marcus $

PORTNAME=	gobject
PORTVERSION=	3.10.2
CATEGORIES=	devel python
MASTER_SITES=	GNOME
MASTER_SITE_SUBDIR=	sources/pygobject/${PORTVERSION:C/^([0-9]+\.[0-9]+).*/\1/}
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
PKGNAMESUFFIX=	3
DISTNAME=	pygobject-${PORTVERSION}
DIST_SUBDIR=	gnome3

MAINTAINER=	gnome@FreeBSD.org
COMMENT=	Python bindings for GObject

LICENSE=	LGPL21

LIB_DEPENDS=	libffi.so:${PORTSDIR}/devel/libffi

USE_XZ=		yes
USES=		gmake pathfix pkgconfig
USE_GNOME=	glib20 introspection:build
USE_PYTHON=	yes
PYTHON_PY3K_PLIST_HACK=	yes
GNU_CONFIGURE=	yes
USE_LDCONFIG=	yes

# this port doesn't work with py-gobject < 2.28.6_2, clungle below
CONFLICTS=	py*-gtk-0* py*-gobject-2.*.[0-6] py*-gobject-2.*.[7-9] \
		py*-gobject-2.*.6_1

PLIST_SUB=	ARCH=${ARCH} UNAME_R=${UNAME_R} VERSION=${PORTVERSION}

CONFIGURE_ARGS=	--enable-cairo

.include <bsd.port.pre.mk>

UNAME_R!=	${UNAME} -r

.if ${PYTHON_REL} > 276
BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}cairo>=1.10:${PORTSDIR}/graphics/py3-cairo
RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}cairo>=1.10:${PORTSDIR}/graphics/py3-cairo
.else
BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}cairo>=1.10:${PORTSDIR}/graphics/py-cairo
RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}cairo>=1.10:${PORTSDIR}/graphics/py-cairo
.endif

post-patch:
	@${REINPLACE_CMD} -e 's|SUBDIRS = examples gi tests|SUBDIRS = examples gi|g' \
		${WRKSRC}/Makefile.in

.include <bsd.port.post.mk>
